import {request} from '@umijs/max';
import * as API from "@/services";


/** 栏目聚焦 分页检索请求 */
export async function queryJournalSpecialColumns(params: API.JournalSpecialColumnPageQueryParams): Promise<API.RespPageResult<API.JournalSpecialColumn>> {
  return request('/api/v1/journal-special-column', {
    params,
  });
}

/** 栏目聚焦 详情请求 */
export async function queryJournalSpecialColumn(bizId: API.EntityId): Promise<API.RespResult<API.JournalSpecialColumn>> {
  return request(`/api/v1/journal-special-column/${bizId}`);
}

/** 栏目聚焦 创建请求 */
export async function createJournalSpecialColumn(entity: API.JournalSpecialColumn_Create): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-column`, {
    method: 'POST',
    data: entity,
  });
}

/** 栏目聚焦 修改请求 */
export async function modifyJournalSpecialColumn(entity: API.JournalSpecialColumn_Modify): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-column/${entity.id}`, {
    method: 'PUT',
    data: entity,
  });
}

/** 栏目聚焦 修改(部分)请求 */
export async function patchJournalSpecialColumn(entity: API.JournalSpecialColumn_Patch): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-column/${entity.id}`, {
    method: 'PATCH',
    data: entity,
  });
}

/** 栏目聚焦 删除请求 */
export async function deleteJournalSpecialColumn(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-column/${bizId}`, {
    method: 'DELETE',
  });
}

/** 栏目聚焦 批量删除请求 */
export async function deleteJournalSpecialColumns(bizIds: API.EntityId[]): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-column`, {
    method: 'DELETE',
    data: {
      ids: bizIds,
    },
  });
}
/** 栏目聚焦 启用 */
export async function enableJournalSpecialColumn(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-column/enable/${bizId}`, {
    method: 'PUT',
  });
}

/** 栏目聚焦 禁用 */
export async function disableJournalSpecialColumn(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-column/disable/${bizId}`, {
    method: 'PUT',
  });
}
